
/*! \class CGame game.js
 *	\brief A class that runs the game
 *	\author Ian T. Jacobsen
 */
 
 
 var CGame = makeClass();
 //! \brief The function prototype.init, is the constructor for the class
 CGame.prototype.init = function( canvasId ) {
	// Get the canvas element
	this.canvas = document.getElementById(canvasId);
	// Get the context
	this.context = this.canvas.getContext('2d');
	
	// Add an event listener that listens for mouse clicks, and then executes the CGame::GetMousePos function
	this.canvas.addEventListener('click', this.GetMousePos, false);
	
 };
 
 CGame.prototype.GetMousePos = function(event) {
	alert("whoop");
 
	var x = event.clientX;
	var y = event.clientY;
	alert("whoop2");
	// Only check for the mouse inside the actual canvas tags
	/*x -= this.canvas.offsetLeft;
	y -= this.canvas.offsetTop;*/
	
	
	alert("x: " + x + "  y: " + y);
	
	//return new CPoint2D(x,y);
 };